#ifndef TCPUSERCONNECT_H
#define TCPUSERCONNECT_H
#include "dbcontroler.h"
#include <QTcpSocket>
#include "protocol.h"
#include <memory>

#include <QJsonObject>
#include <QJsonArray>
#include <QJsonDocument>
class TcpUserConnect : public QTcpSocket
{
    Q_OBJECT
public:
    TcpUserConnect();

    void setUserName(QString Un);

    QString getUserName();

    void _doDownLoad(PDU* recvPDU=nullptr);

public slots:
    void RecvMsg();

    void SendToClient(PDU* RespondData);

    void ActForDisconnect();

    void SendMsg(myuint Type,QJsonObject Info);


signals:
    void ThrowDownload(TcpUserConnect* SelfSocket,QString UserName);

    void ThrowMatchTcpUser(TcpUserConnect* SelfSocket,QString UserName);

private:
    QString _UserName;
};

#endif // TCPUSERCONNECT_H
